package com.xx.mapper;

import com.xx.entity.Products;
import com.xx.entity.ProductsList;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ProductsMapper {
    //ID查询
    ProductsList queryById(Integer productId);

    //查询指定行数据
    List<ProductsList> queryAllByLimit(Products products);

    //统计总行数
    long count(Products products);

    //新增数据
    int insert(Products products);

    //批量新增数据
    int insertBatch(@Param("entities") List<Products> entities);

    //批量新增或按主键更新数据
    int insertOrUpdateBatch(@Param("entities") List<Products> entities);

    //修改数据
    int update(Products products);

    //主键删除
    int deleteById(Integer productId);

    String selectImageUrl(@Param("productId") Integer productId);

}
